home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / dateofw.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  54 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 26.3, p. III-360.
  16. % Original source in file "macros6.TEX", starting line 147.
  17. \wlog{L: "dateofw.tip" ["macros6.TEX," l. 147, p. III-360]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{rangetst.tip}
  20. \catcode`\@ = 11
  21. \def\Sunday{0}
  22. \def\Monday{1}
  23. \def\Tuesday{2}
  24. \def\Wednesday{3}
  25. \def\Thursday{4}
  26. \def\Friday{5}
  27. \def\Saturday{6}
  28. \def\ProvideDayOfWeek #1#2#3{%
  29.     \CheckRange{#1}{0}{6}%
  30.         {\string\ProvideDayOfWeek: day of week outside
  31.             of 0 .. 6 range.}%
  32.     \ifcase #1\relax
  33.         \def#3{Sunday}\or
  34.         \def#3{Monday}\or
  35.         \def#3{Tuesday}\or
  36.         \def#3{Wednesday}\or
  37.         \def#3{Thursday}\or
  38.         \def#3{Friday}\or
  39.         \def#3{Saturday}% 
  40.     \fi
  41.     \ifnum #2 = 0
  42.     \else
  43.         \def\@ProvideDayOfWeek ##1##2##3##4;{%
  44.             \def#3{##1##2##3}%
  45.         }%
  46.         \expandafter\@ProvideDayOfWeek#3;%
  47.     \fi     
  48. }
  49. \def\PrintDayOfWeek #1#2{%
  50.     \ProvideDayOfWeek{#1}{#2}{\@PrintDayOfWeek}%
  51.     \@PrintDayOfWeek
  52. }
  53. \catcode`\@ = 12
  54.